#include "mt006.h"


#define  _KEY_PWR_INIT_   0x01

typedef struct
{
    uint16_t	DebCnt;
    uint8_t   BitInput01;
    uint8_t   BitInput02;
    uint8_t   BitInput03;
    
    uint8_t   BitBak01;
    uint8_t   BitBak02;
    uint8_t   BitBak03;
    uint8_t		Last;     
    uint8_t		Valid;  
    uint8_t		State; 
    uint8_t   Flag;
     
}Key_Typedef;

extern Key_Typedef Key;

void GLED_ONOFF(uint8_t cmd);
void RLED_ONOFF(uint8_t cmd);

int32_t FirstOrder_Filter(int32_t New_Data, int32_t Old_Data, int32_t k); 
int32_t FirstOrder_FIR_Filter(int32_t NewData,int32_t OldData,int32_t k);

void Control_GPIO_Init(void);
void Check_Control_Input(void);

void Hold_Key_Check(uint8_t KeyState);

void SWDIO_Remap_Init(uint8_t IO_Mode);

void LED_Status_Blink(void);
